#include <cmath>
#include "raster_prim_in.h"

RRRasterPrim::RRRasterPrim()
{
  verts_index = 0;
}

RRRasterPoint RRRasterPrim::rrGetPoint(int index)
{
  return verts[index];
}

int RRRasterPrim::rrGetX(int index)
{
  return verts[index].x;
}

int RRRasterPrim::rrGetY(int index)
{
  return verts[index].y;
}

RRPrimitiveType RRRasterPrim::rrGetType()
{
  return t;
}

int RRRasterPrim::rrGetVertsNum()
{
  return verts_index;
}

void RRRasterPrim::rrSetPrim(RRVertexPrim &arg)
{
  t = arg.rrGetType();
  verts_index = arg.rrGetVertsNum();
  int i;
  RRVertexPoint temp_vert_point;;
  for(i=0; i<verts_index; i++) {
    temp_vert_point = arg.rrGetPoint(i);
    verts[i].x = (int)temp_vert_point.x;
    verts[i].y = (int)temp_vert_point.y;
    verts[i].color[0] = temp_vert_point.color[0];
    verts[i].color[1] = temp_vert_point.color[1];
    verts[i].color[2] = temp_vert_point.color[2];
    verts[i].color[3] = temp_vert_point.color[3];
  }
}
